package com.example.yls.demoa;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.io.File;

public class MainActivity extends AppCompatActivity {
    private Button btnInsertStu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnInsertStu = findViewById(R.id.btn_insert_stu);
        btnInsertStu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri = Uri.parse("content://com.gdcp.student/student");
                ContentValues values = new ContentValues();
                values.put("stuno","10086");
                values.put("name","古天乐");
                values.put("age",37);
                getContentResolver().insert(uri,values);
            }

        });


    }

}
